package com.xcity.game.activity.newplayer.tracer;

import java.text.MessageFormat;

import com.xcity.game.activity.newplayer.NewPlayerDoingStr;
import com.xcity.game.activity.newplayer.NewPlayerTask;
import com.xcity.game.activity.newplayer.NewPlayerTracer;
import com.xcity.game.activity.newplayer.NewPlayerTracerLabel;

@NewPlayerTracerLabel(NewPlayerTracer.EMPLOYEE_COUNT)
public class EmployeeCountTracer implements NewPlayerTracer {

	@Override
	public boolean isDone(NewPlayerTask task) {
		int size = task.getVm().getOwner().getEmployees().size();
		if(size >= task.getTemplate().getParam()[0]){
			return true;
		}
		return false;
	}

	@Override
	public void onChange(NewPlayerTask task, Object... vals) {
	}

	@Override
	public String getDoingStr(NewPlayerTask task) {
		return MessageFormat.format(NewPlayerDoingStr.STR_EMPLOYEE_COUNT, task.getTemplate().getParam()[0]);
	}

}
